﻿/***************
 * Copyright 2009 (C) 
 * Timur Fanshteyn
 * Blog: http://blog.tfanshteyn.com
 * ************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Coherence.Contrib
{
    public enum POFWriteAsTypeEnum
    {
        Default,
        Array,
        ArrayUniform,
        Binary,
        Boolean,
        BooleanArray,
        Byte,
        ByteArray,
        Char,
        CharAray,
        CollectionGeneric,
        Collection,
        CollectionUniform,
        Date,
        DateTime,
        DayTimeInterval,
        Decimal,
        DictionaryGeneric,
        Dictionary,
        DictionaryUniform,
        DictionaryUniform2,
        Double,
        DoubleArray,
        Int16,
        Int16Array,
        Int32,
        int32Array,
        Int64,
        Int64Array,
        LocalDateTime,
        LocalTime,
        LongArray,
        LongUniformArray,
        Object,
        RawInt128,
        RawTime,
        RawYearMonthInterval,
        Single,
        SingleArray,
        String,
        Time,
        TimeInterval,
        UniversalDateTime,
        UniversalTime,
    }

    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
    public class POFSerializableMemberAttribute : Attribute
    {
        private int _Order = -1;
        public POFWriteAsTypeEnum WriteAsType { get; set; }
        public int Order
        {
            get { return _Order; }
            set {
                if (value < 0)
                    throw new ArgumentOutOfRangeException("Order must be positive value");
                _Order = value; 
            }
        }
    }
}
